import mongoose from '../dbHelper';
import { defaultSchemaExtend, defaultSchemaOptions } from "../config/index";

const Schema = mongoose.Schema;

const DlyadminAiFuncsConfigSchema = new Schema(Object.assign({
  type: {
    type: String, // 功能预设与前端对应
    required: true,
  },
  name: {
    type: String, // 标题与前端对应
    required: true,
  },

  status: {
    type: String, // 0-禁用 1-启用
    required: true,
    default: '1',
  },
  num: {
    type: Number, // 需使用的积分数
    required: true,
    default: 10,
  },
  // 划线积分
  linenum: {
    type: Number, // 划线积分
    required: true,
  },
  // 收费标准
  charge: {
    type: String, // 0-免费 1-收费
    required: true,
    default: '1',
  },
  // 按类似收费
  similarCharge: {
    type: String, // 0 按次数收费 1 按图片张数收费
    required: true,
    default: '1',
  }

}, defaultSchemaExtend), defaultSchemaOptions);

const DlyadminAiFuncsConfig = mongoose.model('DlyadminAiFuncsConfig', DlyadminAiFuncsConfigSchema, 'DlyadminAiFuncsConfigs');

export default DlyadminAiFuncsConfig